Skip to content

feat(pm-stack): C3 health hooks design and initial runner - #12077

Merged
dezren39 merged 5 commits into
mainfrom
queue/20429-c3-health-hooks
Nov 21, 2026
Merged

dezren39 merged 5 commits into
mainfrom
queue/20429-c3-health-hooks

Conversation

@dezren39

@dezren39 dezren39 commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add the C3 health-hook design: trigger surface, bounded read-only probe sequences, report/evidence shape, escalation rules, and watchdog cutover test.
  • Add initial shared Python runner and shell wrappers for and .
  • Wire the existing stack sentinel transition path to fire-and-forget the matching hook.

Scope and acceptance

This PR lands the design-first slice and initial runner/wiring. It does not claim full issue #9571 acceptance: live caller integrations, true end-to-end event-store/audit writes, category-chat routing, real failure/recovery cycles, and the 14-day cutover test remain follow-up work. See the design's implementation slices.

Verification

  • PASS test_argparse_requires_target
    PASS test_argparse_rejects_bad_target
    PASS test_targets_defined
    PASS test_tcp_probe_shape
    PASS test_http_probe_shape
    PASS test_systemctl_state_shape
    PASS test_git_recent_commits
    PASS test_runner_runs_and_prints_json
    PASS test_runner_pm_stack

  • Bundled 4 modules in 9ms

    stack-sentinel.js 12.1 KB (entry point)

Safety

All diagnostic probes are read-only. The hook does not perform remediation.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 20, 2026 01:03
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 41 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a4c6e03e-f7d5-4a6f-ad66-a40a240ecd9c
Commits

Reviewing files that changed from the base of the PR and between e62c7e4 and 12704e4.

Files selected for processing: 9

  • doc/2026-11-20T00-46-00Z_design_c3-health-hooks/note.md
  • pm-stack/aggregator/scripts/stack-sentinel.ts
  • pm-stack/aggregator/src/health-hook-dispatch.ts
  • pm-stack/aggregator/test/health-hook-dispatch.test.ts
  • pm-stack/health-hooks/README.md
  • pm-stack/health-hooks/opencode-working.sh
  • pm-stack/health-hooks/pm-stack-reachable.sh
  • pm-stack/health-hooks/run.py
  • pm-stack/health-hooks/test_run.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T04:57:04.785589Z 12704e4 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c78931e828

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pm-stack/health-hooks/run.py Resolved
Comment thread pm-stack/health-hooks/run.py Resolved
Comment thread pm-stack/health-hooks/run.py Resolved
Comment thread pm-stack/health-hooks/run.py Resolved
Comment thread pm-stack/health-hooks/run.py Resolved
@dezren39

Copy link
Copy Markdown
Member Author

Follow-up on the existing C3 health-hooks PR: commit 0cd2e0fd54 addresses the seven review findings (correct executable wrappers, supported critical severity, HTTP failure verdicts, linked recovery records, once-per-transition sentinel dispatch, host-health schema parsing, and one shared 60-second deadline).

Focused verification: python3 -I pm-stack/health-hooks/test_run.py (15 tests), bun test test/health-hook-dispatch.test.ts from pm-stack/aggregator (2 tests), bunx tsc --noEmit, and git diff --cached --check all pass. An initial invocation of the Bun test from repo root OOMed; the package-local invocation passed.

This update does not claim full #9571 acceptance. Live caller integrations, end-to-end event-store/audit writes, real failure/recovery cycles, and cutover testing remain outstanding.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0cd2e0fd54

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pm-stack/health-hooks/run.py Resolved
Comment thread pm-stack/health-hooks/run.py Resolved
Comment thread pm-stack/health-hooks/run.py Resolved
Comment thread pm-stack/health-hooks/run.py Resolved
- bws lookups list secrets and fetch by id, as secrets.ts does.
- A recovery posts with its outage's intake key so the intake closes it.
- Session liveness reads session_v2 from the live OpenCode store.
- Inactive oneshots whose last run succeeded are not counted as down.
- A second --target is rejected, so a wrapper can't run the other hook.
- The sentinel records a first up as a baseline instead of launching a hook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 34d1711a4a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pm-stack/health-hooks/run.py Resolved
…ecoveries

The sentinel holds a target's next hook dispatch while that target's
previous hook is still running, so a slow down diagnostic cannot land
after its own recovery. A recovery records whether the intake took it;
an undelivered recovery leaves the outage open, so the next hook run
posts it again under the outage's key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1868966d1a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pm-stack/health-hooks/run.py Resolved
Two callers diagnosing the same outage now share its incident id and
intake key, so one recovery closes the one alert.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dezren39
dezren39 merged commit c83a5fe into main Nov 21, 2026
1 check passed
@dezren39
dezren39 deleted the queue/20429-c3-health-hooks branch November 21, 2026 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants